<?php
declare (strict_types=1);
namespace app\mall\controller;
use app\mall\model\MallSubscription;
use think\admin\Controller;
use think\admin\extend\DataExtend;
use think\admin\helper\QueryHelper;

/**
 * 订阅
 * @class Cate
 * @package app\mall\controller
 */
class Subscription extends Controller
{
   

    /**
     * subscription管理
     * @auth true
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function index()
    {
        MallSubscription::mQuery($this->get)->layTable(function () {
            $this->title = "订阅管理";
        }, static function (QueryHelper $query) {
            $query->like('size');
        });
    }


    /**
     * 添加subscription
     * @auth true
     */
    public function add()
    {
        $this->mode = 'add';
        $this->title = '添加订阅';
        MallSubscription::mForm('form');
    }

    /**
     * 编辑subscription
     * @auth true
     */
    public function edit()
    {
        $this->mode = 'edit';
        $this->title = '编辑订阅';
        MallSubscription::mForm('form');
    }




    /**
     * 删除subscription
     * @auth true
     */
    public function remove()
    {
        MallSubscription::mDelete();
    }


}